<?php
	class Test_Exercice{
		
		private $idRefTest;
		private $idRefExercice;
		private $ordre;
		
		
		public function __construct(){
			if(func_num_args() == 1)
			$this->hydrate(func_get_arg(0));			
		}
		
		public function hydrate(array $donnees){
			foreach ($donnees as $key => $value){
				$method = 'set'.ucfirst($key);
				if (method_exists($this, $method)){
					$this->$method($value);
				}
			}
		}		
		
		// GETTERS
		public function idRefTest(){return $this->idRefTest;}
		public function idRefExercice(){return $this->idRefExercice;}
		public function ordre(){return $this->ordre;}
		
		//SETTERS
		public function setIdRefTest($newIdRefTest){$this->idRefTest = $newIdRefTest;}
		public function setIdRefExercice($newIdRefExercice){$this->idRefExercice = $newIdRefExercice;}
		public function setOrdre($newOrdre){$this->ordre= $newOrdre;}
	}
?>